home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / tcplusx.zip / KEYBOARD.H < prev    next >
C/C++ Source or Header  |  1991-02-28  |  3KB  |  140 lines

  1. #ifndef _KEYBOARD_H
  2. #define _KEYBOARD_H
  3.  
  4. //
  5. // keyboard.h     - header file for class Keyboard
  6. // Author        - Robin W. McKean
  7. // Last Update    - February 21,1991
  8. // Copyright (C) 1991 All rights reserved
  9. //
  10. // This file remains the property of the author, Robin W. McKean.  You are
  11. // free to use and change it as you see fit.  This module, nor its object
  12. // code, may not however be included  in any packaged software without the
  13. // written consent of the author.
  14. //
  15.  
  16. // Contents ----------------------------------------------------------------
  17. //
  18. //        Keyboard
  19. //
  20. // Description
  21. //
  22. //        Defines the class Keyboard.  The purpose of this class is to serve
  23. //        as an input class for recieving information from the keyboard, and
  24. //        turning that information into useful events 
  25. //
  26. // End ---------------------------------------------------------------------
  27.  
  28. // Interface Dependencies ---------------------------------------------------
  29.  
  30. #ifndef _IOSTREAM_H
  31. #include <iostream.h>
  32. #define _IOSTREAM_H
  33. #endif
  34.  
  35. #ifndef _GEN_H
  36. #include <gen.h>
  37. #endif
  38.  
  39. #ifndef _USETYPES_H
  40. #include <usetypes.h>
  41. #endif
  42.  
  43. #ifndef _OBJECT_H
  44. #include <object.h>
  45. #endif
  46.  
  47. #ifndef _EVENT_H
  48. #include <event.h>
  49. #endif
  50.  
  51. #ifndef _DEVICE_H
  52. #include <device.h>
  53. #endif
  54.  
  55. // End Interface Dependencies ------------------------------------------------
  56.  
  57. // Class //
  58.  
  59. class Keyboard : public Device
  60. {
  61. public:
  62.     Keyboard( int initStatus = D_ON );
  63.     Keyboard( Keyboard& );
  64.     ~Keyboard( void );
  65.  
  66.     classType        isA( ) const;
  67.     char            *nameOf( ) const;
  68.  
  69.     int             processA( Event& );
  70.     void            pollDevice( );
  71.  
  72. private:
  73.     int altKeyStatus;
  74.     unsigned char enhancedBIOS;
  75.     unsigned int breakStatus;
  76. };
  77.  
  78. // Description --------------------------------------------------------------
  79. //
  80. //        Defines the keyboard class that will be used to gather input information
  81. //        from the keyboard, translate that into usable information, and send
  82. //        this information to the EventManager.  This object cannot work 
  83. //        without the event manager
  84. //
  85. //    Constructor
  86. //
  87. //        Keyboard( int initStatus = D_ON )
  88. //
  89. //        Initializes the device, and determines its initial status.  It also
  90. //        disables the control break button.
  91. //
  92. //        Keyboard( Keyboard& )
  93. //
  94. //        Copy constructor, copies one device into another.  In this case, we
  95. //        don't do anything, because the constructor initializes everything
  96. //
  97. //    Destructor
  98. //
  99. //        ~Keyboard()
  100. //
  101. //        Resets the control break status
  102. //
  103. //    Member Functions
  104. //
  105. //        isA( )
  106. //
  107. //        Returns character class type keyboardClass
  108. //
  109. //        nameOf( )
  110. //
  111. //        Returns a character representation of class, "Keyboard"
  112. //
  113. //        printOn( ostream& )
  114. //
  115. //        Prints the contents of the class in a logical fashion
  116. //
  117. //        processA( Event& )
  118. //
  119. //        Responsible for taking an event, and processing the contents if
  120. //        applicable to this device
  121. //
  122. //        pollDevice( )
  123. //
  124. //        Requests information from a device, and translated into an event
  125. //        which is fed directly into the event manager's queue.
  126. //
  127. //    Inherited Members
  128. //
  129. //        isSortable( )        inherited from Object
  130. //        isAssociation( )    inherited from Object
  131. //        operator new        inherited from Object
  132. //        firstThat( )        inherited from Object
  133. //        lastThat( )         inherited from Object
  134. //        hashValue( )        inherited from Device
  135. //        isEqual( )            inherited from Device
  136. //
  137. // End Description ----------------------------------------------------------
  138.  
  139. #endif    // _KEYBOARD_H //
  140.